package hu.uszeged.inf.stud.prf.todo.controller.user;

import javax.enterprise.context.RequestScoped;
import javax.inject.Named;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import org.hibernate.validator.constraints.Length;

@Named
@RequestScoped
public class Credentials {
	private String username;

	private String password;
	private String password2;

	@NotNull
	@Length(min = 3, max = 25,  message="Username must be between 3 and 25 character")
	@Pattern(regexp = "[A-Za-z0-9]+", message = "Username must contain only english letters and numbers")
	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	@NotNull
	@Length(min = 5, max = 20, message="Password must be between 5 and 20 character")
	public String getPassword() {
		return password;
	}
	
	public void setPassword2(String password2){
		this.password2=password2;
	}
	
	public String getPassword2() {
		return password2;
	}

	public void setPassword(String password) {
		this.password = password;
	}
}
